package com.it.emall.service;

import com.it.emall.domain.Recipes;

import java.util.List;

/**
 * 商品Service
 */
public interface RecipesService {

    List<Recipes> selectIngredientsList();


    //模糊搜索
    List<Recipes> searchRecipesByKeyword(String search);

    Recipes selectRecipesById(Integer id);

    Recipes selectRecipesByIngredientId(Integer ingredientId);

    //增加食谱
    int addRecipe(Recipes recipes,String ingredientName, String ingredientDesc, String picUrl, String iconUrl, int l1CategoryId);
    /**
     * 更新食谱并同步更新食材表中的 pid 和 name
     */
    int updateRecipeAndSyncCategory(Recipes recipe, Integer pid);
    //删除食谱
    int deleteRecipeById(Integer id, Integer userId);
    //查询食谱
    List<Recipes> selectRecipesByuserId(Integer userId);

    //查询用户发布食谱的详情页 用于修改食谱`
    Recipes selectRecipesByuserIdRecipe(Integer userId, Integer id);



}
